const express = require('express');
const router = express.Router();
const paymentMethodController = require('../controllers/paymentMethodController');
const { authMiddleware } = require('../middleware/auth');

// 获取所有支付方式
router.get('/', paymentMethodController.getAllPaymentMethods);

// 获取单个支付方式
router.get('/:id', paymentMethodController.getPaymentMethodById);

// 创建支付方式 - 需要认证
router.post('/', authMiddleware, paymentMethodController.createPaymentMethod);

// 更新支付方式 - 需要认证
router.put('/:id', authMiddleware, paymentMethodController.updatePaymentMethod);

// 删除支付方式 - 需要认证
router.delete('/:id', authMiddleware, paymentMethodController.deletePaymentMethod);

router.use(authMiddleware);

module.exports = router; 